package com.web.controller;

import com.web.annotation.SecurityParameter;
import com.web.util.resultUtil.ResultModel;
import com.web.util.resultUtil.ResultTools;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.Map;

/**
 * @author : Mr.Yan
 * @program : com
 * @create : 2019-03-27 17:58
 * @description :
 */
@Slf4j
@RestController
public class LoginController {

    /**
     * @Author: Mr.Yan
     * @create: 2019/3/27
     * @MethodName: login
     * @Param: [response, request]
     * @Return: net.sf.json.JSONObject
     * @description: 自动对参数加密解密
     */
    @SecurityParameter(inDecode = false,outEncode = false)
    @RequestMapping("/login")
    public ResultModel login( HttpServletResponse response, HttpServletRequest request,
                              @RequestBody(required = false)  Map<String,Object> map){
        log.info("进入login后台");
        System.out.println("输出account:————————————————" + map.get("account"));
        System.out.println("输出password:————————————————" + map.get("password"));

        Map<String,Object> resultMap =  new HashMap<>();
        resultMap.put("userid","200");
        return ResultTools.result(0,"",resultMap);
    }
}
